<?php
namespace app\controller;

use app\BaseController;
use \think\facade\Request;
use \think\facade\Db;
class Base extends BaseController
{
    // 查询省份数据
	public function lodeProvince()
	{
		  $param = Request::param();
		  $result = Db::table('t_address_province')
		             ->select();
        return $this->returnJson(200,'操作成功',$result);
		  
	}
	// 查询城市数据
	public function lodeCity()
	{
		  $param = Request::param();
          $provinceCode = $param['provinceCode'];
		  $result = Db::table('t_address_city')
                     ->where('provinceCode',$param['provinceCode'])
		             ->select();
        return $this->returnJson(200,'操作成功',$result);
		  
	}
    // 查询区域数据
    public function lodeTown()
	{
		  $param = Request::param();
          $cityCode = $param['cityCode'];
		  $result = Db::table('t_address_town')
                     ->where('cityCode',$param['cityCode'])
		             ->select();
        return $this->returnJson(200,'操作成功',$result);
		  
	}

 
  
}